home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18118 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 73 64 | 63 63 31 32 2e 75 63 73 |Path: sd|cc12.ucs|
|00000010| 64 2e 65 64 75 21 67 6f | 6c 67 69 21 6a 73 74 72 |d.edu!go|lgi!jstr|
|00000020| 6f 75 74 0a 46 72 6f 6d | 3a 20 4a 6f 73 65 70 68 |out.From|: Joseph|
|00000030| 20 53 74 72 6f 75 74 20 | 3c 6a 73 74 72 6f 75 74 | Strout |<jstrout|
|00000040| 40 75 63 73 64 2e 65 64 | 75 3e 0a 4e 65 77 73 67 |@ucsd.ed|u>.Newsg|
|00000050| 72 6f 75 70 73 3a 20 63 | 6f 6d 70 2e 6c 61 6e 67 |roups: c|omp.lang|
|00000060| 2e 63 2b 2b 0a 53 75 62 | 6a 65 63 74 3a 20 52 65 |.c++.Sub|ject: Re|
|00000070| 3a 20 50 72 69 6e 74 69 | 6e 67 20 66 69 78 65 64 |: Printi|ng fixed|
|00000080| 20 6c 65 6e 67 74 68 20 | 63 68 61 72 20 61 72 72 | length |char arr|
|00000090| 61 79 73 20 69 6e 20 43 | 2b 2b 3f 0a 44 61 74 65 |ays in C|++?.Date|
|000000a0| 3a 20 54 68 75 2c 20 31 | 38 20 41 70 72 20 31 39 |: Thu, 1|8 Apr 19|
|000000b0| 39 36 20 31 36 3a 35 32 | 3a 34 34 20 2d 30 37 30 |96 16:52|:44 -070|
|000000c0| 30 0a 4f 72 67 61 6e 69 | 7a 61 74 69 6f 6e 3a 20 |0.Organi|zation: |
|000000d0| 55 6e 69 76 65 72 73 69 | 74 79 20 6f 66 20 43 61 |Universi|ty of Ca|
|000000e0| 6c 69 66 6f 72 6e 69 61 | 2c 20 53 61 6e 20 44 69 |lifornia|, San Di|
|000000f0| 65 67 6f 0a 4d 65 73 73 | 61 67 65 2d 49 44 3a 20 |ego.Mess|age-ID: |
|00000100| 3c 50 69 6e 65 2e 53 47 | 49 2e 33 2e 39 31 2e 39 |<Pine.SG|I.3.91.9|
|00000110| 36 30 34 31 38 31 36 35 | 30 33 36 2e 32 31 38 37 |60418165|036.2187|
|00000120| 39 41 2d 31 30 30 30 30 | 30 40 67 6f 6c 67 69 3e |9A-10000|0@golgi>|
|00000130| 0a 52 65 66 65 72 65 6e | 63 65 73 3a 20 3c 34 6c |.Referen|ces: <4l|
|00000140| 35 6f 64 35 24 37 6b 67 | 40 6e 65 77 73 62 66 30 |5od5$7kg|@newsbf0|
|00000150| 32 2e 6e 65 77 73 2e 61 | 6f 6c 2e 63 6f 6d 3e 0a |2.news.a|ol.com>.|
|00000160| 4e 4e 54 50 2d 50 6f 73 | 74 69 6e 67 2d 48 6f 73 |NNTP-Pos|ting-Hos|
|00000170| 74 3a 20 67 6f 6c 67 69 | 2e 75 63 73 64 2e 65 64 |t: golgi|.ucsd.ed|
|00000180| 75 0a 4d 69 6d 65 2d 56 | 65 72 73 69 6f 6e 3a 20 |u.Mime-V|ersion: |
|00000190| 31 2e 30 0a 43 6f 6e 74 | 65 6e 74 2d 54 79 70 65 |1.0.Cont|ent-Type|
|000001a0| 3a 20 54 45 58 54 2f 50 | 4c 41 49 4e 3b 20 63 68 |: TEXT/P|LAIN; ch|
|000001b0| 61 72 73 65 74 3d 55 53 | 2d 41 53 43 49 49 0a 58 |arset=US|-ASCII.X|
|000001c0| 2d 53 65 6e 64 65 72 3a | 20 6a 73 74 72 6f 75 74 |-Sender:| jstrout|
|000001d0| 40 67 6f 6c 67 69 0a 49 | 6e 2d 52 65 70 6c 79 2d |@golgi.I|n-Reply-|
|000001e0| 54 6f 3a 20 3c 34 6c 35 | 6f 64 35 24 37 6b 67 40 |To: <4l5|od5$7kg@|
|000001f0| 6e 65 77 73 62 66 30 32 | 2e 6e 65 77 73 2e 61 6f |newsbf02|.news.ao|
|00000200| 6c 2e 63 6f 6d 3e 20 0a | 0a 4f 6e 20 31 38 20 41 |l.com> .|.On 18 A|
|00000210| 70 72 20 31 39 39 36 2c | 20 42 6c 75 6d 65 6e 62 |pr 1996,| Blumenb|
|00000220| 65 72 67 20 77 72 6f 74 | 65 3a 0a 0a 3e 20 48 6f |erg wrot|e:..> Ho|
|00000230| 77 20 64 6f 20 49 20 70 | 72 69 6e 74 20 66 69 78 |w do I p|rint fix|
|00000240| 65 64 20 6c 65 6e 67 74 | 68 20 63 68 61 72 20 61 |ed lengt|h char a|
|00000250| 72 72 61 79 73 20 28 6e | 6f 74 20 6e 75 6c 6c 2d |rrays (n|ot null-|
|00000260| 74 65 72 6d 27 65 64 20 | 73 74 72 69 6e 67 73 29 |term'ed |strings)|
|00000270| 20 69 6e 20 43 2b 2b 3f | 0a 3e 20 0a 3e 20 48 6f | in C++?|.> .> Ho|
|00000280| 77 20 77 6f 75 6c 64 20 | 49 20 64 6f 20 74 68 69 |w would |I do thi|
|00000290| 73 20 69 6e 20 43 2b 2b | 20 69 6f 73 74 72 65 61 |s in C++| iostrea|
|000002a0| 6d 73 3f 20 20 49 20 74 | 72 69 65 64 20 70 6c 61 |ms? I t|ried pla|
|000002b0| 79 69 6e 67 20 77 69 74 | 68 20 73 65 74 77 28 29 |ying wit|h setw()|
|000002c0| 20 61 6e 64 0a 3e 20 73 | 65 74 70 72 65 63 69 73 | and.> s|etprecis|
|000002d0| 69 6f 6e 28 29 2c 20 62 | 75 74 20 74 68 65 79 20 |ion(), b|ut they |
|000002e0| 64 6f 6e 27 74 20 70 72 | 6f 64 75 63 65 20 74 68 |don't pr|oduce th|
|000002f0| 65 20 64 65 73 69 72 65 | 64 20 65 66 66 65 63 74 |e desire|d effect|
|00000300| 2e 0a 0a 31 2e 20 47 65 | 74 20 61 20 66 69 78 65 |...1. Ge|t a fixe|
|00000310| 64 2d 6c 65 6e 67 74 68 | 20 73 74 72 69 6e 67 20 |d-length| string |
|00000320| 63 6c 61 73 73 2c 20 73 | 75 63 68 20 61 73 20 6d |class, s|uch as m|
|00000330| 69 6e 65 20 61 74 20 0a | 3c 68 74 74 70 3a 2f 2f |ine at .|<http://|
|00000340| 77 77 77 2d 61 63 73 2e | 75 63 73 64 2e 65 64 75 |www-acs.|ucsd.edu|
|00000350| 2f 7e 6a 73 74 72 6f 75 | 74 2f 63 6c 61 73 73 6c |/~jstrou|t/classl|
|00000360| 69 62 3e 2e 0a 0a 32 2e | 20 55 73 65 20 74 68 65 |ib>...2.| Use the|
|00000370| 20 66 6f 6c 6c 6f 77 69 | 6e 67 3a 20 20 20 63 6f | followi|ng: co|
|00000380| 75 74 20 3c 3c 20 6d 79 | 73 74 72 69 6e 67 3b 0a |ut << my|string;.|
|00000390| 0a 49 66 20 79 6f 75 27 | 72 65 20 74 72 79 69 6e |.If you'|re tryin|
|000003a0| 67 20 74 6f 20 75 73 65 | 20 61 20 63 68 61 72 20 |g to use| a char |
|000003b0| 61 72 72 61 79 20 77 69 | 74 68 6f 75 74 20 77 72 |array wi|thout wr|
|000003c0| 61 70 70 69 6e 67 20 69 | 74 20 69 6e 20 61 20 63 |apping i|t in a c|
|000003d0| 6c 61 73 73 2c 20 79 6f | 75 20 0a 6d 69 67 68 74 |lass, yo|u .might|
|000003e0| 20 61 73 20 77 65 6c 6c | 20 75 73 65 20 43 2e 20 | as well| use C. |
|000003f0| 20 43 2b 2b 20 61 6c 6c | 6f 77 73 20 79 6f 75 20 | C++ all|ows you |
|00000400| 74 6f 20 73 6f 6c 76 65 | 20 70 72 6f 62 6c 65 6d |to solve| problem|
|00000410| 73 20 6c 69 6b 65 20 74 | 68 69 73 20 62 79 20 0a |s like t|his by .|
|00000420| 6d 61 6b 69 6e 67 20 61 | 20 63 6c 61 73 73 20 66 |making a| class f|
|00000430| 6f 72 20 79 6f 75 72 20 | 64 61 74 61 74 79 70 65 |or your |datatype|
|00000440| 20 61 6e 64 20 6f 76 65 | 72 6c 6f 61 64 69 6e 67 | and ove|rloading|
|00000450| 20 6f 70 65 72 61 74 6f | 72 73 20 28 68 65 72 65 | operato|rs (here|
|00000460| 2c 20 3c 3c 29 2e 0a 0a | 2c 2d 2d 2d 2d 2d 2d 2d |, <<)...|,-------|
|00000470| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000480| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000490| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000004a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2e 0a 7c 20 20 |--------|---..| |
|000004b0| 20 20 4a 6f 73 65 70 68 | 20 4a 2e 20 53 74 72 6f | Joseph| J. Stro|
|000004c0| 75 74 20 20 20 20 20 20 | 20 20 20 20 20 44 65 70 |ut | Dep|
|000004d0| 61 72 74 6d 65 6e 74 20 | 6f 66 20 4e 65 75 72 6f |artment |of Neuro|
|000004e0| 73 63 69 65 6e 63 65 2c | 20 55 43 53 44 20 20 20 |science,| UCSD |
|000004f0| 7c 0a 7c 20 20 20 20 6a | 73 74 72 6f 75 74 40 75 ||.| j|strout@u|
|00000500| 63 73 64 2e 65 64 75 20 | 20 20 20 20 20 20 20 20 |csd.edu | |
|00000510| 20 20 68 74 74 70 3a 2f | 2f 77 77 77 2d 61 63 73 | http:/|/www-acs|
|00000520| 2e 75 63 73 64 2e 65 64 | 75 2f 7e 6a 73 74 72 6f |.ucsd.ed|u/~jstro|
|00000530| 75 74 2f 20 20 7c 0a 60 | 2d 2d 2d 2d 2d 2d 2d 2d |ut/ |.`|--------|
|00000540| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000550| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000560| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000570| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 27 0a 0a |--------|--'.. |
+--------+-------------------------+-------------------------+--------+--------+